home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / misc / football / exec / lstats.rexx < prev    next >
OS/2 REXX Batch file  |  1999-11-29  |  23KB  |  814 lines

  1. /* ***********************************************************************
  2.  
  3.    LEAGUE STATS PROGRAM FOR FOOTBALL REXX SUITE
  4.   ----------------------------------------------
  5.                    Copyright  Mark Naughton 1996
  6.  
  7.  
  8. Version    Date     History
  9. --------------------------------------------------------------------------
  10.  1.0       211196   First release. Displays info about the league and then
  11.                     the best record/performance in the league.
  12.            211196   Steve Holland has helped immensely in improving the
  13.                     display and in what stats to display.
  14.  1.1       110497   Added code to support Points_Per_Goals.
  15.            120497   Removed code that adds Points for Goals as the
  16.                     performance options were too far out. A team with a
  17.                     246% record out of 5 matches is too much. Points Per
  18.                     Goals is now mentioned but is NOT used.
  19.            160597   Amended way the number of matches is incremented. Was
  20.                     adding an extra one.
  21.  1.2       250997   Added code for promotions and divisions.
  22.            071297   Amended Highest Home/Away win as 7-0 should be better
  23.                     than 7-2.
  24.            151297   Tidied display.
  25.            160998   Added code to give priority to teams with less goals
  26.                     scored against them. Added code to display all matches
  27.                     which match the highest home/away scores.
  28.            250199   Fixed bugs in calculating the biggest wins where if the
  29.                     match had a clean sheet, no other match could top it
  30.                     unless they had a clean sheet and scored more goals.
  31.            250499   Fixed bug where percentages couldn't be calculated if
  32.                     the results/matches were zero.
  33.  1.3       270699   Added code for top scorers, fair play table, highest
  34.                     and lowest attendances and the fastest goal.
  35.  
  36.  1.4       120899   New variable "prerstring". Search for "heiko" ;-)
  37.                     localized texts you can see at "txt_...". Update by
  38.                     Heiko Schroder.
  39.  
  40.  1.41      160899   Attends of all matches and divided to one match (sum_attd)
  41.                     Update by Heiko Schroder. Redesigned display.
  42.            250899   Added error msg to file checks.
  43.            270899   Converted to use locale. Some error messages, before
  44.                     reading the locale, will still be in English.
  45.                     Heiko has produced localised this script. Amendments
  46.                     made including localising errors and adding the same
  47.                     locale data-read code.
  48.            010999   More tidying up. Top scorers now do not show own goals.
  49.            110999   Tidied display again - fixed bug where the first
  50.                     character of the undefeated team was overwritten.
  51.            141099   Yellow-Red cards are now handled properly.
  52.  
  53. **************************************************************************
  54.  
  55. Procedure
  56. ---------
  57.  
  58. 1. Check files exist. Open 'Teams.df' file and read data into array/variables.
  59. 2. Open Learn file and read a line.
  60. 3. Store data on the teams that played a match (Win/Draw/Loss) for Record
  61.    and Performance.
  62. 4. Store stats for the league.
  63. 5. Calculate the biggest win/loss.
  64. 6. Read Learn file and produce stats on scorers, cards and attendances. If
  65.    required, write data to file for sorting.
  66. 6. Format data produced for Record and Performance.
  67. 7. Display data then exit...
  68.  
  69. ************************************************************************** */
  70. PARSE ARG league_stuff
  71.  
  72. version      = 1
  73. input_file   = '.df'
  74. input2_file  = '.sflearn'
  75. title        = '*LEAGUE_NAME='
  76. points_win   = '*POINTS_PER_WIN='
  77. points_drw   = '*POINTS_PER_DRW='
  78. points_lse   = '*POINTS_PER_LSE='
  79. points_gls   = '*POINTS_PER_GLS='
  80. releg        = '*RELEGATION='
  81. playother    = '*PLAY_OTHER='
  82. promoted     = '*PROMOTED='
  83. num_divs     = '*NUM_DIVISIONS='
  84. divisions    = '*DIVISIONS='
  85. pkauthor     = '*  Author ='
  86. pkversion    = '*  Version='
  87. pkdate       = '*  Date   ='
  88. separator    = '*'
  89. not_played   = '__   __'
  90. teams.       = '???'
  91. records.     = '???'
  92. undefeat.    = '???'
  93. ustring.     = '???'
  94. rstring.     = '???'
  95. mats.        = '???'
  96. pct.         = '???'
  97. tcount       = 0
  98. lversion     = '1.0'
  99. lreg         = 2
  100. lplayo       = 2
  101. ptsgls       = 0
  102. ndivs        = 1
  103. promo        = 0
  104. divs         = ''
  105.  
  106. home_def     = '*HG='
  107. away_def     = '*AG='
  108. yellowc      = 'Y='
  109. redc         = 'R='
  110. yredc        = 'YR='
  111. attd_def     = '*ATD='
  112. sum_attd     = 0
  113. goalsc.      = '???'
  114. goalscorers. = '???'
  115. goalss.      = '???'
  116. gscount      = 0
  117. gscounter    = 0
  118. fgoal        = 300
  119. fmatch       = ""
  120. fscorer      = ""
  121. hamatch      = ""
  122. hanum        = 0
  123. lamatch      = ""
  124. lanum        = 999999999
  125. ycards.      = '???'
  126. rcards.      = '???'
  127. fside        = 0
  128.  
  129. empty     = ""
  130.  
  131.  
  132. parse var league_stuff league_file
  133. league_file = "Data/" || league_file
  134.  
  135. if open(datafile,"Data/Football.locale",'r') then do
  136.    line = readln(datafile)
  137.    locdir = strip(line)
  138.    close(datafile)
  139. end
  140. else do
  141.    say
  142.    say "ERROR :    (LStats / League Information)"
  143.    say
  144.    say "Cannot read 'Data/Football.locale' for the locale settings."
  145.    exit
  146. end
  147.  
  148. dfordir = locdir"Football.locale_data"
  149. locdir = locdir"Exec/LStats.data"
  150.  
  151. if open(datafile,"ENV:FootballRXPath",'r') then do
  152.    line = readln(datafile)
  153.    rxdir = strip(line)
  154.    close(datafile)
  155. end
  156. else
  157.    rxdir = "SYS:Rexxc/"
  158.  
  159. if exists(locdir) > 0 then do
  160.   address command rxdir'rx 'locdir
  161.   VarCount = getclip('VarCount')
  162.   do i = 1 to VarCount
  163.     interpret getclip('var.'i)
  164.   end
  165. end
  166. else do
  167.    say
  168.    say "ERROR :    (LStats / League Information)"
  169.    say
  170.    say "Cannot find '"locdir"' to read locale settings."
  171.    exit
  172. end
  173.  
  174. if exists(dfordir) > 0 then do
  175.   address command rxdir'rx 'dfordir
  176.   VarCount = getclip('VarCount')
  177.   do i = 1 to VarCount
  178.     interpret getclip('var.'i)
  179.   end
  180. end
  181. else do
  182.    say
  183.    say "ERROR :    (Stats)"
  184.    say
  185.    say "Cannot find '"dfordir"' to read date locale settings."
  186.    exit
  187. end
  188.  
  189. if exists(league_file || input_file) = 0  then do
  190.    say
  191.    say txt_error
  192.    say
  193.    say txt_ls1"'"league_file||input_file"'."
  194.    exit
  195. end
  196.  
  197. if exists(league_file || input2_file) = 0 then do
  198.    say
  199.    say txt_error
  200.    say
  201.    say txt_ls1"'"league_file||input2_file"'."
  202.    exit
  203. end
  204.  
  205. if open(datafile,league_file || input_file,'r') then do
  206.    do while ~eof(datafile)
  207.       line = readln(datafile)
  208.       if pos(title,line) > 0 then        league_title = delstr(line,1,13)
  209.       if pos(pkauthor,line) > 0 then     author       = delstr(line,1,12)
  210.       if pos(pkversion,line) > 0 then    lversion     = delstr(line,1,12)
  211.       if pos(pkdate,line) > 0 then       ddate        = delstr(line,1,12)
  212.       if pos(points_win,line) > 0 then   ptswin       = delstr(line,1,16)
  213.       if pos(points_drw,line) > 0 then   ptsdrw       = delstr(line,1,16)
  214.       if pos(points_lse,line) > 0 then   ptslse       = delstr(line,1,16)
  215.       if pos(points_gls,line) > 0 then   ptsgls       = delstr(line,1,16)
  216.       if pos(releg,line) > 0 then        lreg         = delstr(line,1,12)
  217.       if pos(playother,line) > 0 then    lplayo       = delstr(line,1,12)
  218.       if pos(promoted,line) > 0 then     promo        = delstr(line,1,10)
  219.       if pos(num_divs,line) > 0 then     ndivs        = delstr(line,1,15)
  220.       if pos(divisions,line) > 0 then    divs         = delstr(line,1,11)
  221.       if pos(separator,line) = 0 then do
  222.          line = strip(line)
  223.          tcount         = tcount + 1
  224.          teams.tcount   = line
  225.          records.tcount = 0
  226.          undefeat.tcount= ''
  227.          mats.tcount    = 0
  228.          pct.tcount     = 0
  229.       end
  230.    end
  231.    close(datafile)
  232. end
  233. else do
  234.    say
  235.    say txt_error
  236.    say
  237.    say txt_ls2"'"league_file||input_file"'"txt_ls4
  238.    exit
  239. end
  240.  
  241. line_ct = 0
  242. matches = 0
  243. high_df = 0
  244. high_ht = ''
  245. high_at = ''
  246. high_hw = 0
  247. high_aw = 0
  248. high_hs = 0
  249. high_as = 0
  250. draws   = 0
  251. hwins   = 0
  252. awins   = 0
  253. type    = 0
  254. hcls    = 99
  255. acls    = 99
  256. nlines. = '???'
  257. nlcnt   = 0
  258. if open(datafile,league_file || input2_file,'r') then do
  259.    do while ~eof(datafile)
  260.       line_ct = line_ct + 1
  261.       line = readln(datafile)
  262.       if pos(separator,line) = 0 then do
  263.          if pos(not_played,line) = 0 then do
  264.             home_team = strip(substr(line,1,30))
  265.             goals_for = substr(line,32,2)
  266.             goals_aga = substr(line,37,2)
  267.             away_team = strip(substr(line,41,30))
  268.             call save_data(home_team,away_team,goals_for,goals_aga)
  269.  
  270.             if home_team ~= away_team & home_team ~= '' & away_team ~= '' then
  271.                matches   = matches + 1
  272.             diff = 0
  273.             if goals_for = goals_aga & home_team ~= away_team then do
  274.                draws = draws + 1
  275.                type = 0
  276.             end
  277.             if goals_for > goals_aga then do
  278.                hwins = hwins + 1
  279.                diff  = goals_for - goals_aga
  280.                type  = 1
  281.             end
  282.             if goals_for < goals_aga then do
  283.                awins = awins + 1
  284.                diff  = goals_aga - goals_for
  285.                type  = 2
  286.             end
  287.             if type = 1 then do
  288.                if diff >= high_hw then do
  289.                   nlcnt = nlcnt + 1
  290.                   nlines.nlcnt = line
  291.                   if ((goals_for > high_hs) | (diff = goals_for)) | (diff = high_hw & goals_aga <= hcls) then do
  292.                      high_hw = diff
  293.                      hcls    = goals_aga
  294.                      high_hs = goals_for
  295.                      high_ht = line
  296.                   end
  297.                end
  298.             end
  299.             if type = 2 then do
  300.                if diff >= high_aw then do
  301.                   nlcnt = nlcnt + 1
  302.                   nlines.nlcnt = line
  303.                   if ((goals_aga > high_as) | (diff = goals_aga)) | (diff = high_aw & goals_for <= acls) then do
  304.                      high_as = goals_aga
  305.                      high_at = line
  306.                      high_aw = diff
  307.                      acls    = goals_for
  308.                   end
  309.                end
  310.             end
  311.             type = 0
  312.          end
  313.       end
  314.    end
  315.    close(datafile)
  316. end
  317. else do
  318.    say
  319.    say txt_error
  320.    say
  321.    say txt_ls2"'"league_file||input2_file"'"txt_ls4
  322.    exit
  323. end
  324.  
  325.  
  326. /* code to check for top goal scorer and attendances */
  327.  
  328.  
  329. yellred = 0
  330.  
  331. do ii=1 to tcount
  332.    ycards.ii = 0
  333.    rcards.ii = 0
  334. end
  335.  
  336. j = 0
  337. if open(datafile,league_file || input2_file,'r') then do
  338.    do while ~eof(datafile)
  339.       line = readln(datafile)
  340.       if pos(separator,line) = 0 then do
  341.          if pos(not_played,line) = 0 then do
  342.             j = 0
  343.             home_team = strip(substr(line,1,30))
  344.             goals_for = substr(line,32,2)
  345.             goals_aga = substr(line,37,2)
  346.             away_team = strip(substr(line,41,30))
  347.             j = 1
  348.          end
  349.       end
  350.       else do
  351.          if j > 0 & pos("(og)",line) = 0 then do
  352.             if pos(home_def,line) > 0 then do
  353.                gscount = gscount + 1
  354.                parse var line "*HG=" goalsc.gscount
  355. /* Heiko, Team of Goaler */
  356.                goalsc.gscount.1 = home_team
  357. /* END */
  358.             end
  359.             if pos(away_def,line) > 0 then do
  360.                gscount = gscount + 1
  361.                parse var line "*AG=" goalsc.gscount
  362.                goalsc.gscount.1 = away_team
  363. /* END */
  364.             end
  365.             if pos(yellowc,line) > 0 & pos(yredc,line) = 0 then do
  366.                if pos("*H",line) > 0 then
  367.                   searchfp = home_team
  368.                else
  369.                   searchfp = away_team
  370.                do ii=1 to tcount
  371.                   if pos(searchfp,teams.ii) > 0 then
  372.                      ycards.ii = ycards.ii + 1
  373.                end
  374.                yellred = 1
  375.             end
  376.             if pos(yredc,line) > 0 then do
  377.                if pos("*H",line) > 0 then
  378.                   searchfp = home_team
  379.                else
  380.                   searchfp = away_team
  381.                do ii=1 to tcount
  382.                   if pos(searchfp,teams.ii) > 0 then do
  383.                      ycards.ii = ycards.ii + 1
  384.                      rcards.ii = rcards.ii + 1
  385.                   end
  386.                end
  387.                yellred = 1
  388.             end
  389.             if pos(redc,line) > 0 & pos(yredc,line) = 0 then do
  390.                if pos("*H",line) > 0 then
  391.                   searchfp = home_team
  392.                else
  393.                   searchfp = away_team
  394.                do ii=1 to tcount
  395.                   if pos(searchfp,teams.ii) > 0 then
  396.                      rcards.ii = rcards.ii + 1
  397.                end
  398.                yellred = 1
  399.             end
  400.             if pos("G=",line) > 0 then do
  401.                if pos("(P)",line) > 0 then do
  402.                   kl = pos("(P)",line)
  403.                   goalsc.gsc = delstr(line,kl,3)
  404.                end
  405.                klk = words(line)
  406.                if datatype(word(line,klk)) = "NUM" then do
  407.                   if word(line,klk) < fgoal then do
  408.                      ffscorer = delword(line,klk,1)
  409.                      parse var ffscorer . "G=" fscorer
  410.                      fgoal = word(line,klk)
  411.                      fmatch= home_team"  "right(goals_for,2)"  "right(goals_aga,2)"  "away_team
  412.                      if pos("*HG=",ffscorer) > 0 then fside = 1
  413.                      if pos("*AG=",ffscorer) > 0 then fside = 2
  414.                   end
  415.                end
  416.             end
  417.             if pos(attd_def,line) > 0 then do
  418.                parse var line "*ATD=" attend
  419.                if attend > hanum then do
  420.                   hanum = attend
  421.                   hamatch = home_team || txt_versus || away_team
  422.                end
  423.                if attend < lanum then do
  424.                   lanum = attend
  425.                   lamatch = home_team || txt_versus || away_team
  426.                end
  427.                sum_attd=sum_attd+attend
  428.             end
  429.          end
  430.       end
  431.    end
  432.    close(datafile)
  433. end
  434. else do
  435.    say
  436.    say txt_error
  437.    say
  438.    say txt_ls3"'"league_file || input2_file"'."
  439.    exit
  440. end
  441.  
  442. if gscount > 0 then do
  443.    do gsc=1 to gscount
  444.       if pos("(P)",goalsc.gsc) > 0 then do
  445.          kl = pos("(P)",goalsc.gsc)
  446.          goalsc.gsc = delstr(goalsc.gsc,kl,3)
  447.       end
  448.       klk = words(goalsc.gsc)
  449.       if datatype(word(goalsc.gsc,klk)) = "NUM" then
  450.          goalsc.gsc = delword(goalsc.gsc,klk,1)
  451.    end
  452.  
  453.    do gsc=1 to gscount
  454.       name = goalsc.gsc
  455.       team = goalsc.gsc.1
  456.       notin = 0
  457.       do ii=1 to gscounter
  458.          if pos(name,goalscorers.ii) > 0 then do
  459.             goalss.ii = goalss.ii + 1
  460.             notin = 1
  461.          end
  462.       end
  463.       if notin = 0 then do
  464.          gscounter = gscounter + 1
  465.          goalscorers.gscounter = name
  466. /* Heiko, Team of Goaler */
  467.          goalscorers.gscounter.1 = team
  468. /* End */
  469.          goalss.gscounter  = 1
  470.       end
  471.    end
  472. end
  473.  
  474. if gscounter > 1 then do
  475.    if open(datafile,"RAM:Football.tempcup",'w') then do
  476.       do ii=1 to gscounter
  477. /* Heiko, Team of Goaler */
  478.          writeln(datafile,left(goalss.ii,4)"     "goalscorers.ii"    "goalscorers.ii.1)
  479. /* end */
  480.       end
  481.       close(datafile)
  482.    end
  483.    else do
  484.       say
  485.       say txt_error
  486.       say
  487.       say txt_ls5
  488.       exit
  489.    end
  490.    address command 'Exec/Sort4Chars '
  491.    address command 'c:Rename >NIL: RAM:Football.tempcup as RAM:Football.tempcup2'
  492. end
  493.  
  494. if open(datafile,"RAM:Football.tempcup",'w') then do
  495.    do ii=1 to tcount
  496.       writeln(datafile,left(ycards.ii+(rcards.ii*2),4)"     "left(teams.ii,30)"   "right(ycards.ii,4)"   "right(rcards.ii,4))
  497.    end
  498.    close(datafile)
  499. end
  500. else do
  501.    say
  502.    say txt_error
  503.    say
  504.    say txt_ls5
  505.    exit
  506. end
  507. address command 'Exec/Sort4Chars '
  508.  
  509. r  = 0
  510. rc = 0
  511. u  = 1
  512. uc = 0
  513. do i=1 to tcount
  514.    if records.i ~= 0 | mats.i ~= 0 then do
  515.       pct.i = trunc((records.i/(mats.i*ptswin) * 100),1)
  516.       if pct.i > r then r = pct.i
  517.    end
  518.    else
  519.       pct.i = "0.0"
  520. end
  521.  
  522.  
  523. do i=1 to tcount
  524.    if pct.i = r then do
  525.       rc = rc + 1
  526.       /* changes by Heiko */
  527.       prerstring = records.i || txt_brecord1 || mats.i || txt_brecord2 || pct.i || txt_brecord3
  528.       rstring.rc = teams.i
  529.       /* end changes by Heiko */
  530.    end
  531. end
  532.  
  533.  
  534. do i=1 to tcount
  535.    if length(undefeat.i) > u then
  536.       u  = length(undefeat.i)
  537. end
  538.  
  539. do i=1 to tcount
  540.    if length(undefeat.i) = u then do
  541.       uc = uc + 1
  542.       undefeat.i=strip(undefeat.i)
  543.       ucn = (length(undefeat.i) * 2) - 1
  544.       call format_perf(undefeat.i,ucn)
  545.       if ucn = 1 then ptemp = undefeat.i
  546.       if length(ptemp) > 0 then
  547.          ustring.uc = "           " || left(teams.i,30) || " (" || ptemp || ")"
  548.    end
  549. end
  550.  
  551. hmw   = trunc((hwins/matches) * 100,1)
  552. dm    = trunc((draws/matches) * 100,1)
  553. amw   = trunc((awins/matches) * 100,1)
  554.  
  555. /* Heiko */
  556. hwins = centre(hwins,2)
  557. draws = centre(draws,2)
  558. awins = centre(awins,2)
  559.  
  560. say
  561. say center(txt_league_title||league_title,78)
  562. say "-------------------------------------------------------------------------------"
  563. say
  564. say "                                               "txt_author || author
  565. say "                                               "txt_ddate || ddate
  566. say "                                               "txt_lversion || lversion
  567. say
  568. say txt_matches || matches
  569. say
  570. say txt_hwins || hwins"  ( "hmw"% )"
  571. say txt_draws || draws"  ( "dm"% )"
  572. say txt_awins || awins"  ( "amw"% )"
  573. say
  574.  
  575. attd_int=trunc(sum_attd/matches,0)
  576. say txt_sum_attd  || sum_attd
  577. say txt_sum_attd2 || insert(" ",attd_int,0,Length(sum_attd)-Length(attd_int))
  578. say
  579.  
  580. say txt_ptswin || ptswin
  581. say txt_ptsdrw || ptsdrw
  582. say txt_ptslse || ptslse
  583. say txt_ptsgls || ptsgls "    "txt_ls8
  584. say
  585. say txt_promo || promo
  586. say txt_lreg || lreg
  587. say txt_lplayo || lplayo
  588. say
  589. say txt_ls6""ndivs - 1
  590. say txt_ls7""divs
  591. say "_______________________________________________________________________________"
  592. say
  593. if gscounter > 0 then do
  594.    say txt_topgoal
  595.    say txt_topgoal_line
  596.    say txt_topgoal1
  597.    say txt_topgoal1_line
  598.    if gscounter = 1 then do
  599.       say "  1) " right(goalss.1,2) "  "strip(goalscorers.1)"  ("goalscorers.1.1")"
  600.       say
  601.    end
  602.    else do
  603.       ii = 0
  604.       if open(datafile,"RAM:Football.tempcup2",'r') then do
  605.          do while ~eof(datafile)
  606.             line = readln(datafile)
  607.             if line ~= "" & ii < 10 then do
  608.                parse var line total player rest
  609.                ii = ii + 1
  610. /* Heiko, Team of Goaler */
  611.                say " "right(ii,2)") " right(strip(total,'T'),2) "  "strip(player)"  ("strip(rest)")"
  612. /* end */
  613.             end
  614.          end
  615.          close(datafile)
  616.          say
  617.       end
  618.       else do
  619.          say
  620.          say txt_error
  621.          say
  622.          say txt_ls9
  623.          say
  624.       end
  625.       address command 'delete >NIL: RAM:Football.tempcup2'
  626.    end
  627. end
  628.  
  629. if yellred > 0 then do
  630.    ii = 0
  631.    if open(datafile,"RAM:Football.tempcup",'r') then do
  632.       do while ~eof(datafile)
  633.          line = readln(datafile)
  634.          if line ~= "" then do
  635.             parse var line total rest
  636.             ii = ii + 1
  637.             ycards.ii = strip(rest)"   "right(total,5)
  638.          end
  639.       end
  640.       close(datafile)
  641.       say
  642.    end
  643.    else do
  644.       say
  645.       say txt_error
  646.       say
  647.       say txt_ls10
  648.       say
  649.    end
  650.    address command 'delete >NIL: RAM:Football.tempcup'
  651.  
  652.    say
  653.    say txt_fplay
  654.    say txt_fplay_line
  655.    say txt_fplay1
  656.    say txt_fplay1_line
  657.    do ii=1 to tcount
  658.       say right(ii,3)") "ycards.ii
  659.    end
  660.    say
  661.    say
  662. end
  663.  
  664. if gscounter > 0 | yellred > 0 then do
  665.    say "_______________________________________________________________________________"
  666.    say
  667. end
  668. say txt_brecord
  669. say txt_brecord_line
  670.  
  671. /* changes by Heiko */
  672. rstring.1 = insert(prerstring,rstring.1,0)
  673. empty     = insert(" ",empty,0,length(prerstring))
  674. do i=1 to tcount
  675.    if rstring.i ~= "" & rstring.i ~= '???' then
  676.       if i = 1 then say rstring.i
  677.       else say empty || rstring.i
  678. end
  679. /* end changes by Heiko */
  680. say
  681. say txt_cbur
  682. say txt_cbur_line
  683. say
  684. /* ustring.1 = overlay(u || txt_match3,ustring.1,1) */
  685. ustring.1 = u || txt_match3||strip(ustring.1)
  686. do i=1 to uc
  687.    if i=1 then say ustring.i
  688.    else say " "ustring.i
  689.  
  690. end
  691. say
  692. say "-------------------------------------------------------------------------------"
  693.  
  694. say
  695. say txt_bhw
  696. say txt_bhw_line
  697. hline = substr(high_ht,32,2)"   "substr(high_ht,37,2)
  698. if hline ~= "" then do
  699.    do i=1 to nlcnt
  700.       if pos(hline,nlines.i) > 0 then
  701.          say nlines.i
  702.    end
  703. end
  704. else
  705.    say txt_ls11
  706. say
  707. say
  708. say txt_baw
  709. say txt_baw_line
  710. aline = substr(high_at,32,2)"   "substr(high_at,37,2)
  711. if aline ~= "" then do
  712.    do i=1 to nlcnt
  713.       if pos(aline,nlines.i) > 0 then
  714.          say nlines.i
  715.    end
  716. end
  717. else
  718.    say txt_ls11
  719. say
  720. say
  721. if hanum > 0 then do
  722.    say txt_hatt
  723.    say txt_hatt_line
  724.    say txt_crowd || hanum
  725.    say txt_match || hamatch
  726.    say
  727.    say
  728. end
  729. if lanum ~= 999999999 then do
  730.    say txt_latt
  731.    say txt_latt_line
  732.    say txt_crowd || lanum
  733.    say txt_match || lamatch
  734.    say
  735.    say
  736. end
  737. if fgoal ~= 300 then do
  738.    say txt_fgoal
  739.    say txt_fgoal_line
  740.    if fside = 0 then fsside = txt_fside0
  741.    if fside = 1 then fsside = txt_fside1
  742.    if fside = 2 then fsside = txt_fside2
  743.    say txt_player || strip(fscorer) || txt_fgoal1 || fgoal || txt_fgoal2 || fsside
  744.    say txt_match2 ||fmatch
  745.    say
  746.    say
  747. end
  748. say "_______________________________________________________________________________"
  749. exit
  750.  
  751. /* Routine ---------------------------------------------------------- */
  752.  
  753. save_data:
  754. PARSE ARG homet,awayt,gf,ga
  755.  
  756. h = 0
  757. a = 0
  758. do i=1 to tcount
  759.    if pos(strip(homet),teams.i) > 0 then do
  760.       h = i
  761.       mats.i = mats.i + 1
  762.    end
  763.    if pos(strip(awayt),teams.i) > 0 then do
  764.       mats.i = mats.i + 1
  765.       a = i
  766.    end
  767. end
  768. if a = 0 | h = 0 then return
  769.  
  770. if gf > ga then do
  771.    records.h = records.h + ptswin
  772.    records.a = records.a + ptslse
  773.    undefeat.h = insert(txt_w,undefeat.h,length(undefeat.h),1)
  774.    undefeat.a = ''
  775. end
  776. if gf < ga then do
  777.    records.a = records.a + ptswin
  778.    records.h = records.h + ptslse
  779.    undefeat.a = insert(txt_w,undefeat.a,length(undefeat.a),1)
  780.    undefeat.h = ''
  781. end
  782. if gf = ga then do
  783.    records.a = records.a + ptsdrw
  784.    records.h = records.h + ptsdrw
  785.    undefeat.a = insert(txt_d,undefeat.a,length(undefeat.a),1)
  786.    undefeat.h = insert(txt_d,undefeat.h,length(undefeat.h),1)
  787. end
  788. /*
  789. records.a = records.a + (ga * ptsgls)    PTS_PER_GLS - NOT USED FOR PERFORMANCE...
  790. records.h = records.h + (gf * ptsgls)
  791. */
  792. return
  793.  
  794. /* Routine ---------------------------------------------------------- */
  795.  
  796. format_perf:
  797. ARG fstrg,counter
  798.  
  799. ptemp = ''
  800. ii = 1
  801. jj = 1
  802. do while ii <= counter
  803.    ptemp = insert(substr(fstrg,jj,1),ptemp,ii,1)
  804.    ii = ii + 1
  805.    jj = jj + 1
  806.    if ii < counter then do
  807.       ptemp = insert(".",ptemp,ii,1)
  808.       ii = ii + 1
  809.    end
  810. end
  811. ptemp = strip(ptemp)
  812. return
  813.  
  814. /* ------------------------------------------------------------------ */